import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class FinanceGatheringDetailService {

  // 收款明细tableData
  collectionDetailsUrl = '/order/collection';
  // 收款明细导出
  collectionExportUrl = '/order/collectionExcel';
  // 订单售后详情table
  modelDetailsUrl = '/orderRefund/findOrderRefund';

  constructor(public httpClient: HttpClient) { }

  /**
   * 收款明细table
   * @params params
   */
   public async getTableData(params: any) {
    return await this.httpClient.post(this.collectionDetailsUrl, params).toPromise();
  }

  /**
   * 订单售后详情table
   * @params params
   */
   public async getOrderTableData(params: any) {
    return await this.httpClient.post(this.modelDetailsUrl, params).toPromise();
  }

  // 售后明细tabledata导出
  public collectionExportTable(params?: any) {
    return this.httpClient.get(this.collectionExportUrl, { params, responseType: 'blob' }).toPromise();
  }

}



